home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
os2
/
vsoup11.zip
/
kill.hh
< prev
next >
Wrap
Text File
|
1996-08-01
|
2KB
|
67 lines
// $Id: kill.hh 1.6 1996/08/01 12:11:21 hardy Exp $
//
// This progam/module was written by Hardy Griech based on ideas and
// pieces of code from Chin Huang (cthuang@io.org). Bug reports should
// be submitted to rgriech@ibm.net.
//
// This file is part of soup++ for OS/2. Soup++ including this file
// is freeware. There is no warranty of any kind implied. The terms
// of the GNU Gernal Public Licence are valid for this piece of software.
//
#ifndef __KILL_HH__
#define __KILL_HH__
#include <regexp.h>
#include <stdio.h>
#include "mts.hh"
class TKillFile {
private:
//
// kill regular expression
//
typedef struct aExp {
struct aExp *next; // next in list
regexp *re; // compiled regular expression
} Exp;
//
// kill file entry for a newsgroup
//
typedef struct aGroup {
struct aGroup *next; // next in list
const char *name; // newsgroup name
Exp *expList; // list of kill expressions
} Group;
Group *globalKill; // global kill
Group *groupKillList; // list of group specific kills
int maxLines; // max no of lines allowed for article
TSemaphor sema;
Group *cacheGroupKill;
const char *cacheGroupName;
void killGroup( Group *gp );
Exp *readExp(const char *searchIn, const char *searchFor);
int matchExp(Group *pGroup, const char *buf);
Group *getGroupP( const char *groupName );
public:
TKillFile( void );
~TKillFile();
TKillFile( const TKillFile &right ); // copy constructor not allowed !
operator = (const TKillFile &right); // assignment operator not allowed !
int readFile( const char *killFile, int maxLines = 0 );
int matchLine( const char *groupName, const char *line );
int doKillQ( const char *groupName );
};
#endif // __KILL_HH__